‹#›
Autodesk Inventor 定制开发在线培训 2010
•
1.ThisApplication 在 VB.Net 中不存在
§插件在 Activate 方法中可以自动获取 Application 对象
2.枚举常数需要完全限定
§不能用:
oExtrude.Operation = kJoinOperation
§必须用:
oExtrude.Operation =
•
3.方法的参数默认类型为 ByVal （VBA 中为 ByRef）
§Sub GetFeatureInfo( Feature As PartFeature, Suppressed As Boolean, _ DimCount As Long)
4.变量只在块单元范围内有效
•VB 和 VB.Net 的不同之处
oExtrude.Operation = kJoinOperation
oExtrude.Operation = PartFeatureOperationEnum.kJoinOperation
Sub GetFeatureInfo(Feature As PartFeature, _
Suppressed As Boolean, DimCount As Long)

| - ThisApplication does not exist. You could of course create a variable called like that and set it to the Inventor Application object you get in the Activate method of your AddIn
| - you have to add the enum name before the enum value, to make it fully qualified
| - you have to explicitly say ByRef when you want to pass in some input as reference
| - in VBA if you define a variable inside a section of For Each, While, if, and so on, then that variable can be used anywhere in that function. That is not the case in the .NET languages including VB.NET.